import request from "@/utils/request";

// 获取咨询师的预约列表
export const consultantAppointmentList = async (params) => {
    try {
        const res = await request.get("/api/appointment/consultantList.do", { params });
        return res.data;
    } catch (error) {
        console.error("获取预约列表失败:", error);
        throw error;
    }
};

// 获取当前用户的预约记录
export function getMyAppointments() {
  return request.get('/api/appointment/my.do')
}

// 取消预约
export function cancelAppointment(id) {
  return request.get(`/api/appointment/cancel.do?id=${id}`)
}